package com.qf.controller;

import com.qf.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/stu")
public class StudentController {

    @RequestMapping(value = "/regist",method = {RequestMethod.POST})
    public String regist(String name,Integer age,String password){
        System.out.println("name=" + name);
        System.out.println("age=" + age);
        System.out.println("password=" + password);

        return "forward:/index.jsp";
    }

    @RequestMapping("/login")
    public String login(@RequestParam("sname") String name, @RequestParam("pwd") String password){
        System.out.println("name=" + name);
        System.out.println("password=" + password);

        return "forward:/index.jsp";
    }

    @RequestMapping("/login2")
    public String login2(Student stu){

        System.out.println(stu);

        return "forward:/index.jsp";
    }
}
